package net.suncapper.wcss.web.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import net.suncapper.wcss.common.JsonResponse;
import net.suncapper.wcss.service.ISkuService;
import net.suncapper.wcss.model.domain.Sku;


/**
 *
 *  前端控制器
 *
 *
 * @author ztr
 * @since 2025-11-10
 * @version v1.0
 */
@RestController
@RequestMapping("/api/sku")
public class SkuController {

    private final Logger logger = LoggerFactory.getLogger( SkuController.class );

    @Autowired
    private ISkuService skuService;


    /**
    * 描述：根据Id 查询
    *
    */
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public JsonResponse<Sku> getById(@PathVariable("id") Long id)throws Exception {
        Sku sku = skuService.getById(id);
        return JsonResponse.success(sku);
    }
}

